package controller

import (
	"github.com/gin-gonic/gin"
	"mz_water/controller/admin"
	adminLigin "mz_water/controller/admin/login"
	"mz_water/controller/api"
	pipixia "mz_water/controller/api/PIPIXIA"
	zuiyou "mz_water/controller/api/ZUIYOU"
	"mz_water/controller/api/setWater"
	"mz_water/controller/login"
)

func GinRouter(r *gin.Engine) *gin.Engine {
	rr := r.Group("/")
	rr.POST("/api/login", login.Login)
	rr.GET("/api/getOriginalAddress", setWater.SetWater)
	rr.GET("/api/getPiPiXia", pipixia.GetPiPiXia)
	rr.GET("/api/getZuoYou", zuiyou.GetZuoYou)
	rr.GET("/admin/login", adminLigin.Login)
	rr.POST("/admin/register", adminLigin.Register)
	admin.Routers(rr)
	api.Routers(rr)
	return r
}
